fix(imp): refresh search list after trash delete#92
Merged
Conversation
When use_trash is enabled, do not paint an optimistic \Deleted flag on delete. Force a search viewport refresh after deletion so moved messages leave the result list. If move-to-trash cannot run (no expunge rights), fall back to mark-as-deleted instead of a silent no-op.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes inconsistent delete behavior for messages deleted from search results by ensuring Trash-mode deletes behave like normal mailbox deletes (move to Trash / disappear), and by forcing a viewport refresh so session-synthetic search BUIDs don’t leave stale rows behind.
Changes:
- Skip the client-side optimistic
\Deletedpaint when the viewport is in “Trash mode” (nodeleteshow), relying on server/viewport updates instead. - Always trigger a full viewport refresh after deletions in search mailboxes so rebuilt result sets and synthetic BUIDs stay consistent.
- When move-to-Trash can’t be attempted due to missing expunge rights, fall back to marking messages as
\Deleted(instead of doing nothing).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lib/Indices.php |
Makes Trash move conditional on expunge rights and ensures non-move cases still perform mark-as-deleted cleanup. |
lib/Ajax/Application.php |
Forces full viewport refresh after deletes when the active mailbox is a search mailbox. |
js/base.js |
Avoids optimistic \Deleted flag painting when nodeleteshow indicates Trash-mode UI behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\Deletedmark whenuse_trashis enabled.Motivation
Deleting multiple messages from IMP search results painted them as deleted but left them in place, while the same action from a normal mailbox correctly honored the Trash preference.
Changes
js/base.js: skip optimistic\Deletedwhen viewport metadatanodeleteshowis set (Trash mode).lib/Ajax/Application.php: force a full viewport refresh after delete in search mailboxes.lib/Indices.php: treat failed move-to-trash (no expunge ACL) as mark-as-deleted rather than a silent no-op.Test plan
js/base.jsis loaded.